package sharetime.playlist.domain;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import sharetime.core.EntityObject;
import sharetime.user.domain.UserData;

@Entity
@Table(name = "resource_comment")
public class ResourceComment extends EntityObject{

	private static final long serialVersionUID = 2794265419467285283L;
	private String title;
    private Date date;
    private String body;
    
    private Resource resource;
    private UserData owner;

    /**
     * Gets the value of title
     *
     * @return the value of title
     */
    public String getTitle()  {
	return this.title;
    }

    /**
     * Sets the value of title
     *
     * @param argTitle Value to assign to this.title
     */
    public void setTitle(String argTitle) {
	this.title = argTitle;
    }

    /**
     * Gets the value of date
     *
     * @return the value of date
     */
    public Date getDate()  {
	return this.date;
    }

    /**
     * Sets the value of date
     *
     * @param argDate Value to assign to this.date
     */
    public void setDate(Date argDate) {
	this.date = argDate;
    }

    /**
     * Gets the value of body
     *
     * @return the value of body
     */
    public String getBody()  {
	return this.body;
    }

    /**
     * Sets the value of body
     *
     * @param argBody Value to assign to this.body
     */
    public void setBody(String argBody) {
	this.body = argBody;
    }

    /**
     * Gets the value of resource
     *
     * @return the value of resource
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "fk_resource_id")
    public Resource getResource()  {
	return this.resource;
    }

    /**
     * Sets the value of resource
     *
     * @param argResource Value to assign to this.resource
     */
    public void setResource(Resource argResource) {
	this.resource = argResource;
    }

    
    /**
     * Gets the value of owner
     *
     * @return the value of owner
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "fk_userdata_id")
    public UserData getOwner()  {
	return this.owner;
    }

    /**
     * Sets the value of owner
     *
     * @param argOwner Value to assign to this.owner
     */
    public void setOwner(UserData argOwner) {
	this.owner = argOwner;
    }

	@Override
	public String toString() {
		return this.title;
	}
}
